# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=keybase-client
pkgver=5.2.1
pkgrel=6
pkgdesc="CLI client for keybase.io"
url="https://github.com/keybase/client"
arch="all"
license="BSD-3-Clause"
makedepends="go"
options="!check" # need access to localhost:3000, which doesn't work with our infra
source="$pkgname-$pkgver.tar.gz::https://github.com/keybase/client/archive/v$pkgver.tar.gz"
builddir="$srcdir/client-$pkgver"

build() {
	cd "$srcdir"
	export GOPATH="$PWD"
	export GO15VENDOREXPERIMENT=1
	export GO111MODULE=off

	mkdir -p src/github.com/keybase
	cp -r "$srcdir/client-$pkgver" src/github.com/keybase/client
	cd src/github.com/keybase/client/go/keybase
	go build -v -a -tags production -o "$srcdir/keybase"
}

package() {
	install -Dm755 "$srcdir/keybase" "$pkgdir/usr/bin/keybase"
}

sha512sums="5ef045e714209d732c8b421f9a27cd32026dfd83af321bdc2be191ad8d5d458a947cd44b9b644e44c98fdcaefe9a17f0dd5546edd7bf97c3fb3cd97dd08cbc54  keybase-client-5.2.1.tar.gz"
